<?php
/**
 * main right theme
 * @package Theme
 * @subpackage View
 */
$login = array(
	'name'	=> 'login',
	'id'	=> 'login',
	'value' => set_value('login'),
	'maxlength'	=> 80,
	'size'	=> 30,
);
$login_by_username = ($this->config->item('login_by_username', 'tank_auth') AND
                    $this->config->item('use_username', 'tank_auth'));
$login_by_email = $this->config->item('login_by_email', 'tank_auth');
if ($login_by_username AND $login_by_email) {
	$login_label = 'Email or login';
} else if ($login_by_username) {
	$login_label = 'Login';
} else {
	$login_label = 'Email';
}
$password = array(
	'name'	=> 'password',
	'id'	=> 'password',
	'size'	=> 30,
);
$remember = array(
	'name'	=> 'remember',
	'id'	=> 'remember',
	'value'	=> 1,
	'checked'	=> set_value('remember'),
	'style' => 'margin:0;padding:0',
);
$captcha = array(
	'name'	=> 'captcha',
	'id'	=> 'captcha',
	'maxlength'	=> 8,
);
?>
<div class="grid_4">
    <?php if(!isset($show_captcha)){ //ถ้าเปิด show captcha ให้ปิด panel นี้ ?>
    <div class="panel_box">
        <h3>Login</h3>
        <form action="/auth/login" method="post" class="form_login">
            <fieldset>
                <legend>Login</legend>
                
                <div><?php echo form_label($login_label, $login['id']); ?><?php echo form_input($login); ?></div>
                <div><?php echo form_label('Password', $password['id']); ?><?php echo form_password($password); ?></div>
                
                <div><?php echo form_checkbox($remember); ?>
			<?php echo form_label('Remember me', $remember['id']); ?></div>
                <div>	<?php echo anchor('/auth/forgot_password/', 'Forgot password'); ?>
			<?php if ($this->config->item('allow_registration', 'tank_auth')) echo anchor('/auth/register/', 'Register'); ?></div>
                <?php echo form_submit('submit', 'Let me in'); ?>
                
            </fieldset>
        <?php echo form_close(); ?>
    </div>
    <?php } ?>
</div>